







Algorithms..::DisjointSets<(Of <T>)> Method (IEnumerable<(Of <T>)>, IEnumerable<(Of <T>)>, IEqualityComparer<(Of <T>)>) |
See Also |
![]() ![]() |
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they
have no common items.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public static bool DisjointSets<T>( IEnumerable<T> collection1, IEnumerable<T> collection2, IEqualityComparer<T> equalityComparer ) |
Visual Basic (Declaration) |
---|
Public Shared Function DisjointSets(Of T) ( _ collection1 As IEnumerable(Of T), _ collection2 As IEnumerable(Of T), _ equalityComparer As IEqualityComparer(Of T) _ ) As Boolean |
Visual C++ |
---|
public: generic<typename T> static bool DisjointSets ( IEnumerable<T>^ collection1, IEnumerable<T>^ collection2, IEqualityComparer<T>^ equalityComparer ) |
Parameters
- collection1
- IEnumerable<(Of <T>)>
The first collection.
- collection2
- IEnumerable<(Of <T>)>
The second collection.
- equalityComparer
- IEqualityComparer<(Of <T>)>
The IEqualityComparerComparer<T> used to compare items for equality. Only the Equals and GetHashCode member functions of this interface are called.
Return Value
True if collection1 are collection2 are disjoint, considered as sets.
Type Parameters
- T
Remarks
If both collections are Set, Bag, OrderedSet, or OrderedBag collections, it is more efficient to use the IsDisjoint method on that class.
Exceptions
Exception | Condition |
---|---|
System..::ArgumentNullException | collection1 or collection2 is null. |
See Also
Algorithms Class
Wintellect.PowerCollections Namespace